
"""
this is function  description
"""

from flask import Flask


from config import config

# 数据库
# db = SQLAlchemy()
from .models import db


# 工厂模式
def create_app():
    app = Flask(__name__, template_folder='./templates', static_folder="./static")

    # app 读取配置文件
    app.config.from_object(config)

    # 初始化数据库
    db.init_app(app)

    return app
